package logic

import (
	"context"
	"rpc/model/redis"

	"rpc/internal/svc"
	"rpc/pb/cart"

	"github.com/zeromicro/go-zero/core/logx"
)

type CartCheckedLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCartCheckedLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CartCheckedLogic {
	return &CartCheckedLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *CartCheckedLogic) CartChecked(in *cart.CartCheckedRequest) (*cart.CartCheckedResponse, error) {
	// todo: add your logic here and delete this line
	redis.CartChecked(in.UserId, in.Checked)

	return &cart.CartCheckedResponse{}, nil
}
